"""
项目：Ai-Engineer自适应工程设计自动化插件
作者：刘昊轩、李佳音、刘伟伟、杨明久（排序不分先后）
©版权保护
"""


class EngineeringKnowledge:
    MATERIALS = {
        "Q235": {
            "density": 7.85e-6,  # kg/mm³
            "yield_strength": 235,  # MPa
            "cost_per_kg": 4.5
        },
        "6061铝合金": {
            "density": 2.7e-6,
            "yield_strength": 275,
            "cost_per_kg": 25.0
        }
    }

    MANUFACTURING = {
        "CNC铣削": {
            "min_hole_diameter": 2.0,
            "max_depth_ratio": 10,
            "cost_per_hour": 120.0
        },
        "3D打印": {
            "min_wall_thickness": 0.5,
            "max_build_size": [300, 300, 300],
            "cost_per_gram": 0.8
        }
    }

    @classmethod
    def get_material_property(cls, material, prop):
        return cls.MATERIALS.get(material, {}).get(prop)

    @classmethod
    def calculate_weight(cls, volume, material):
        density = cls.get_material_property(material, "density")
        return density * volume if density else None